package com.biz.primus.ms.depot.feign;

import com.biz.primus.model.geo.vo.*;
import com.biz.primus.ms.depot.degraded.DegradedGeoFeignClient;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author defei
 * @date 2017/9/13
 */
@FeignClient(qualifier = "geoFeignClient", name = "service-geo", fallback = DegradedGeoFeignClient.class)
public interface GeoFeignClient {

    /**
     * 经纬度解码到城市ID
     *
     * @param reqVo 解码对象
     * @return CityItemRespVo
     */
    @PostMapping("decodeLocation")
    CityItemRespVo decodeLocation(@RequestBody LocationDecodeRequestVo reqVo);

    /**
     * 查省
     *
     * @param provinceId 省ID
     * @return ProvinceResponseVo
     */
    @GetMapping("findProvince")
    ProvinceResponseVo findProvince(@RequestParam("provinceId") Long provinceId);

    /**
     * 查城市
     *
     * @param cityId 城市ID
     * @return CityResponseVo
     */
    @GetMapping("findCity")
    CityResponseVo findCity(@RequestParam("cityId") Long cityId);

    /**
     * 查区域
     *
     * @param districtId 区ID
     * @return DistrictResponseVo
     */
    @GetMapping("findDistrict")
    DistrictResponseVo findDistrict(@RequestParam("districtId") Long districtId);

}
